package chap3_10;

import java.util.Scanner;

public class Exer3_10_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int h, w;
        while (true) {
            System.out.println("长方形的高为：");
            h = input.nextInt();
            System.out.println("长方形的宽为：");
            w = input.nextInt();
            if (h > 3 && w > 3) {
                break;
            }
            System.out.println("输错了，请重新输入：");
        }
        for (int i = 1; i <= h; i++) {
            for (int j = 1; j <= w; j++) {
                if (i == 1 || i == h || j == 1 || j == w) {
                    System.out.print("*");
                    continue;
                }
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
}
